package nc.pub.gl.tools;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import nc.jdbc.framework.processor.BaseProcessor;

public class ColumnMapProcessor extends BaseProcessor {

	private static final long serialVersionUID = 1726214299514750057L;
	private String columnNameKey = null;
    private String columnNameValue = null;
    
    public ColumnMapProcessor(String columnNameKey, String columnNameValue) {
        this.columnNameKey = columnNameKey;
        this.columnNameValue = columnNameValue;
    }
	@Override
	public Object processResultSet(ResultSet rs) throws SQLException {
		Map<String,String> result = new HashMap<String,String>();
        while (rs.next()) {
        	result.put(rs.getString(columnNameKey), rs.getString(columnNameValue));
        }
        return result;
	}

}
